package com.iyundao.io.mapper;

import com.iyundao.io.model.UserDept;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface UserDeptMapper {
    @Insert({
        "insert into user_dept (uid, did)",
        "values (#{uid,jdbcType=CHAR}, #{did,jdbcType=CHAR})"
    })
    int insert(UserDept record);

    @InsertProvider(type=UserDeptSqlProvider.class, method="insertSelective")
    int insertSelective(UserDept record);

    @Select("select * from user_dept where uid=#{sid,jdbcType=VARCHAR}")
    UserDept selectByUid(String sid);

    @Update("update user_dept set did={did,jdbcType=VARCHAR}")
    int update(UserDept userDept);
}